export enum TransactionType {
  Income = 1,
  Expense = 2,
  Refund = 3,
}

export enum PaymentMethod {
  WeChat = 1,
  Alipay = 2,
  Balance = 3,
  Offline = 4,
}

export enum TransactionStatus {
  Completed = 1,
  Pending = 2,
  Failed = 3,
}

export interface Transaction {
  id: number;
  order_id: number;
  order_no: string;
  amount: number; // in cents
  type: TransactionType;
  payment_method: PaymentMethod;
  status: TransactionStatus;
  description: string;
  created_at: number;
}

export interface FinanceQuery {
  page?: number;
  pageSize?: number;
  keyword?: string; // search by order_no
  type?: TransactionType;
  status?: TransactionStatus;
}

export interface FinanceListData {
  list: Transaction[];
  total: number;
}